package com.xiaoran.robot.customHandler;
import com.xiaoran.robot.entity.SenderInfo;
import com.xiaoran.robot.service.PlmmService;
import com.xiaoran.robot.utils.MessageParser;
import com.xiaoran.robot.utils.RstMsgUtils;
import com.xiaoran.robot.utils.SpringUtil;
import com.xiaoran.robot.utils.YamlReader;

import java.util.ArrayList;

/**
 * 返回小姐姐图片
 */
public class Plmm {
    private static final String API = "https://api.nmb.show/xiaojiejie1.php";
    private static final String BasePath = YamlReader.instance.getValueByKey("mirai.plmmPath").toString();
    private static final PlmmService plmms =   SpringUtil.getBean(PlmmService.class);

    public ArrayList<Object> result(){
        MessageParser instance = MessageParser.getInstance();
        SenderInfo senderInfo= instance.senderInfo();
        String id = senderInfo.getQid();
        RstMsgUtils rstMsg = new RstMsgUtils();
        if(senderInfo.getType().equals("GroupMessage")){
            rstMsg.atQQ(id);
        }
        rstMsg.addText("小姐姐来咯").addImageUrl(plmms.randomOne());
        return rstMsg.build();
    }

}
